<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style = "width:900px; font-size: .6rem;">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">修改运输供方基本字段</h4>
    </div>

    <form class="form-horizontal ms-form modal-search-form" role="form" method="POST" action="${ctx.host}/suppliers/${supplierId}/trans-supplier"
          data-validate="true" data-anchor="#anchor-trans-supplier">
    
      <input type="hidden" name="_method" value="PATCH" />
      <input type="hidden" name="id" value="${transSupplier.id}" />
      
        <div class="modal-body">
           
          <div class="form-horizontal ms-form form-personal-info">
          
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-3">25&nbsp;<span class="color-red">*</span>单车月行驶公里数(公里/板)：</label>
              <div class="col-xs-3 pull-left">
                <input type="text" name="monthlyMileage" class="form-control" data-validate="required|number" value="${transSupplier.monthlyMileage}" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
            
              <label class="control-label col-xs-3">26&nbsp;<span class="color-red">*</span>（公路）单车重载率（%）：</label>
              <div class="col-xs-3 pull-left">
                <input type="text" name="heavyLoadRate" class="form-control" data-validate="required|number|length_between,1,2" value="${transSupplier.heavyLoadRate}" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
            </div>
        
             <div class="form-group ms-form-group">
              <label class="control-label col-xs-3 ">27.1&nbsp;<span class="color-red">*</span>GPS安装情况：</label>
              <div class="col-xs-3 pull-left">
                <select class="select2 form-control" name="gpsBrand"  data-validate="required" tabindex="1">
                  <option ></option>
                  <c:forEach var="gpsBrand" items="${enums['GpsBrandType'] }">
                  <option value="${ gpsBrand.code}" ${transSupplier.gpsBrand eq gpsBrand.code ? 'selected' : ''}>${gpsBrand.description}</option>
                  </c:forEach>
                </select>
              </div>
            
              <label class="control-label col-xs-3">27.2&nbsp;<span class="color-red">*</span>GPS是否和安吉物流GPS平台兼容：</label>
              <div class="col-xs-3 pull-left">
                <select class="select2 form-control" name="compatible"  data-validate="required" tabindex="1">
                  <option ></option>
                   <option value="true" ${transSupplier.compatible ? 'selected' : ''}>是</option>
                   <option value="false"  ${not transSupplier.compatible ? 'selected' : ''}>否</option>
                </select>
             </div>
           </div>
            
         </div>

        <div class="modal-footer ms-modal-footer">
          <button type="submit" class="btn ms-btn btn-primary">确定</button>
          <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
        </div>
      </div>
    </form>
      
  </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('select[name="gpsBrand"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });
        
        $('select[name="compatible"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });

    })
</script>
